// 设计用户的表模型
const mongoose = require('mongoose')
const Schema = mongoose.Schema

// 设计用户模型
const UserSchema = new Schema({
  account: {
    type: String,
    require: true
  },
  username: {
    type: String,
    require: true
  },
  data: {
    type: String,
    require: true
  },
})

// 通过 mongoose.model 往数据库里面映射出一张User表
module.exports = mongoose.model('favorites', UserSchema)
